﻿using System;
using System.Net.Mail;
using System.Windows.Forms;

namespace SendMailIPCC
{
    public partial class frmLoading : Form
    {
        SmtpClient SmtpServer;
        MailMessage mail;
        public frmLoading()
        {
            InitializeComponent();
        }
        public frmLoading(SmtpClient s, MailMessage m)
        {
            InitializeComponent();
            SmtpServer = s;
            mail = m;
        }

        private void frmLoading_Load(object sender, EventArgs e)
        {
            timer1.Enabled = true;

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            SmtpServer.Send(mail);
            MessageBox.Show("Đã gởi thành công...",
               "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Dispose();
        }
    }
}
